#ifndef OCK_MEMORY_BRIDGE_OCK_ACLADAPTER_OCK_ASYNC_TASK_BASE_H
#define OCK_MEMORY_BRIDGE_OCK_ACLADAPTER_OCK_ASYNC_TASK_BASE_H
#include <cstdint>
#include <ostream>

#include "ock/hmm/mgr/OckHmmHMObject.h"
#include "ock/acladapter/data/OckTaskResourceType.h"
#include "ock/acladapter/executor/OckTaskStatisticsMgr.h"

namespace ock {
namespace acladapter {

class OckAsyncTaskParamBase
{
public:
    virtual ~OckAsyncTaskParamBase() noexcept = default;
};

class OckDftAsyncTaskBase : public OckAsyncTaskParamBase
{
public:
    virtual ~OckDftAsyncTaskBase() noexcept = default;
    explicit OckDftAsyncTaskBase(void) = default;
};

std::ostream &operator<<(std::ostream &os, const OckAsyncTaskParamBase &data);
std::ostream &operator<<(std::ostream &os, const OckDftAsyncTaskBase &data);

class OckAsyncTaskContext
{
public:
    virtual ~OckAsyncTaskContext() noexcept = default;
    virtual hmm::OckHmmDeviceId GetDeviceId(void) const = 0;
    virtual std::shared_ptr<OckTaskStatisticsMgr> StatisticsMgr(void) = 0;
};
std::ostream &operator<<(std::ostream &os, const OckAsyncTaskContext &context);

class OckAsyncTaskBase
{
public:
    virtual ~OckAsyncTaskBase() noexcept = default;
    virtual std::string Name(void) const = 0;
    virtual std::string ParamInfo(void) const = 0;

    virtual OckTaskResourceType ResourceType(void) const = 0;
    virtual bool PreConditionMet(void) = 0;
    virtual void Run(OckAsyncTaskContext &context) = 0;
    virtual void Cancel(void) = 0;
};

class OckAsyncTaskBase
{
public:
    virtual ~OckAsyncTaskBase() noexcept = default;
    virtual std::string Name(void) const = 0;
    virtual std::string ParamInfo(void) const = 0;

    virtual OckTaskResourceType ResourceType(void) const = 0;
    virtual bool PreConditionMet(void) = 0;
    virtual void Run(OckAsyncTaskContext &context) = 0;
    virtual void Cancel(void) = 0;
};

class OckTaskConditionWaitBase
{
public:
    virtual ~OckTaskConditionWaitBase() noexcept = default;
    virtual bool Wait(void) = 0;
};

class OckUserWaitInfoBase
{
public:
    virtual ~OckUserWaitInfoBase() noexcept = default;
    virtual bool WaitTimeOut(void) = 0;
};

std::ostream &operator<<(std::ostream &os, const OckAsyncTaskBase &task);

}
}
#endif